package cn.bytecollege.admin.controller; /**
 * @Auther：MR.P
 * @Date:2021/10/28 16 52
 * @Description:
 */

import cn.bytecollege.admin.service.PaymentService;
import cn.bytecollege.common.entity.Payment;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;
import java.util.List;

@WebServlet(name = "PaymentListController", value = "/admin/paymentList")
public class PaymentListController extends HttpServlet {
    private PaymentService paymentService = null;
    public PaymentListController(){
        paymentService = new PaymentService();
    }
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request,response);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
       //查询所有支付方式
        List<Payment> list = paymentService.find();
        request.setAttribute("list",list);
        request.getRequestDispatcher("/admin/html/device/paymentList.jsp").forward(request,response);
    }
}
